﻿using System;

namespace DambachMulti.DataStructures
{
	public delegate T		Reducer		<T>	( T first, T second	);
	public delegate bool	ExitEarly	<T>	( T item			);

	interface IFunctional<T>
	{		
		/// <summary>
		/// Apply a function to each element in a sequence
		/// </summary>		
		void Map ( Action<T> method );

		/// <summary>
		/// Reduce a sequence to a single value
		/// </summary>		
		T Reduce ( Reducer<T> reducer ); //creates one value by acting on each pair in a sequence

		/// <summary>
		/// Return all elements in a sequence that pass the predicate
		/// </summary>		
		void Filter ( Predicate<T> conditional );
	}
}
